package proxy;

import java.io.File;
import java.rmi.Remote;
import java.rmi.RemoteException;

import message.response.MessageResponse;
import client.IRMICallback;

/**
 * 
 * @author matthiaskaran
 *
 */

public interface IRemoteObject extends Remote {
	
	/**
	 * Returns the number of Read-Quorums that are currently used for the replication mechanism
	 * @return number of Read-Qourums
	 * @throws RemoteException
	 */
	public int readQuorum() throws RemoteException;
	
	/**
	 * Returns the number of Write-Quorums that currently used for the replication mechanism
	 * @return number of Write-Quorums
	 * @throws RemoteException
	 */
	public int writeQuorum() throws RemoteException;
	
	/**
	 * Returns a sorted list that contains the 3 files that got downloaded the most
	 * @return list of files
	 * @throws RemoteException
	 */
	public MessageResponse topThreeDownloads() throws RemoteException;
	
	/**
	 * Creates a subscription for the given file
	 * @param filename
	 * @param numberOfDownloads
	 * @throws RemoteException
	 */
	public MessageResponse subscribe(String filename, int numberOfDownloads, IRMICallback client) throws RemoteException;
	
	/**
	 * A User can use this command to retrieve the Proxys public key
	 * @return
	 * @throws RemoteException
	 */
	public MessageResponse getProxyPublicKey() throws RemoteException;
	
	/**
	 * With this command the user can exchange its own public key with the Proxy. 
	 * @param username
	 * @param fileContent
	 * @return
	 * @throws RemoteException
	 */
	public MessageResponse setUserPublicKey(String username, String fileContent) throws RemoteException;
	
	/**
	 * Test Method for RMI
	 * @return
	 * @throws RemoteException
	 */
	public MessageResponse rmitest() throws RemoteException;
	
	
}
